<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .city-box{
            box-shadow: 0 0 12px #999;
            padding: 20px 0px;
            border-radius: 8px;
            width: 600px;
        }
        .city-box .title{
            font-size: 20px;
            padding: 0px 20px 20px 20px;
            border-bottom: 1px solid #ccc;
        }
        .city-box .title>span:last-child{
            font-size: 12px;
            color: #ff4500;
        }
        .city-box .btns{
            padding: 20px 20px 0px 20px;
            display: flex;
            flex-flow: row nowrap;
        }
        .city-box .btns .btn{
            flex-grow: 1;
            margin: 0px 10px;
            background-color: #dedede;
            border-radius: 8px;
            text-align: center;
            padding: 10px;
            cursor: pointer;
            user-select: none;
        }
        .city-box .btns .btn.active{
            background-color: #ff4500;
            color: white;
        }
    </style>
    <script src="../assets/js/vue.js"></script>
    <!-- <script src="../assets/js/vue.min.js"></script> -->
</head>
<body>
    <!-- 
        页面 - 视图  view mode
        数据 - 数据  data mode
        vm - viewModel

        以视图为驱动 - 判断页面视图需要完成什么操作，由js逻辑控制数据完成DOM操作
        以数据为驱动 - 判断页面视图需要完成什么操作，构建对应的响应式数据结合响应式功能完成页面渲染
     -->

     <div id="app">
        <!-- BFC -->
        <div class="city-box">
            <div class="title">
                <span>区域：</span>
                <span>{{ c }}</span>
            </div>
            <div class="btns">
                <!-- v-bind 只能对 class 和 style 实现动静结合绑定 -->
                <div class="btn" :class=" c == '江浙沪' ?'active':'' "  @click=" c = '江浙沪' " >江浙沪</div>
                <div class="btn" :class=" c == '珠三角' ?'active':'' "  @click=" c = '珠三角' " >珠三角</div>
                <div class="btn" :class=" c == '北京' ?'active':'' "  @click=" c = '北京' " >北京</div>
            </div>
        </div>


     </div>

     <script>

        new Vue({
            el:"#app",
            data:{
                c:"请选择区域"
            }
        })

     </script>


</body>
</html>